package com.example.chapter.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.chapter.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper extends BaseMapper<User> {


    User selectByUsername(String username);
    @Select("select count(1) from user where username = #{username}")
    int findUserByName(User user);

    @Insert("insert into user(username,password,sex) values (#{username},#{password},#{sex})")
    int creatUser(User user);
}
